package JavaEE.ManyThread7;

import java.util.Timer;
import java.util.TimerTask;

public class Demo2 {
    public static void main(String[] args) {
        // 简单的定时器使用~
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("执行任务");
                return;
            }
        },3000);
        System.out.println("开始执行");

    }
}
